Prefix unnamed union structure fields with __extension__ to make it
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Mar 2008 18:02:00 +0000 (18:02 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Mar 2008 18:02:00 +0000 (18:02 +0000)
work properly even in e.g. C99 standard mode.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/include/xen-foreign/mkheader.py
xen/include/public/arch-ia64.h
xen/include/public/arch-x86/xen-x86_64.h

index 3d75a7a4b663873eddd0935f927c45956648f94c..ba6f98cfce447d8b0dacbfc0fe56a951e0cf5771 100644 (file)
@@ -38,7 +38,7 @@ inttypes["x86_64"] = {
 };
 header["x86_64"] = """
 #ifdef __GNUC__
-# define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
+# define __DECL_REG(name) __extension__ union { uint64_t r ## name, e ## name; }
 # define __align8__ __attribute__((aligned (8)))
 #else
 # define __DECL_REG(name) uint64_t r ## name
index e4cf73fc17e9dbcdd37c9b703ed907ac723e4ed3..afb2a52164ee901b7ec2db0c392c09b6390ba302 100644 (file)
@@ -64,6 +64,8 @@ typedef unsigned long xen_pfn_t;
 
 #ifndef __ASSEMBLY__
 
+#define __anonymous_union __extension__ union
+
 typedef unsigned long xen_ulong_t;
 
 #ifdef __XEN_TOOLS__
@@ -165,11 +167,11 @@ struct mapped_regs {
     unsigned long  reserved1[29];
     unsigned long  vhpi;
     unsigned long  reserved2[95];
-    union {
+    __anonymous_union {
         unsigned long  vgr[16];
         unsigned long bank1_regs[16]; // bank1 regs (r16-r31) when bank0 active
     };
-    union {
+    __anonymous_union {
         unsigned long  vbgr[16];
         unsigned long bank0_regs[16]; // bank0 regs (r16-r31) when bank1 active
     };
@@ -180,7 +182,7 @@ struct mapped_regs {
     unsigned long  vpsr;
     unsigned long  vpr;
     unsigned long  reserved4[76];
-    union {
+    __anonymous_union {
         unsigned long  vcr[128];
         struct {
             unsigned long dcr;  // CR0
@@ -214,7 +216,7 @@ struct mapped_regs {
             unsigned long rsv6[46];
         };
     };
-    union {
+    __anonymous_union {
         unsigned long  reserved5[128];
         struct {
             unsigned long precover_ifs;
@@ -608,7 +610,7 @@ struct xen_ia64_boot_param {
 struct xen_ia64_opt_feature {
        unsigned long cmd;              /* Which feature */
        unsigned char on;               /* Switch feature on/off */
-       union {
+       __anonymous_union {
                struct {
                                /* The page protection bit mask of the pte.
                                 * This will be or'ed with the pte. */
index 843c0bbbdc109c7b2d18a8f6f3e0940061957375..d07f03904bd7178ff2ab42c01f92eefcc4a23ab8 100644 (file)
@@ -142,7 +142,7 @@ struct iret_context {
 
 #ifdef __GNUC__
 /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
-#define __DECL_REG(name) union { \
+#define __DECL_REG(name) __extension__ union { \
     uint64_t r ## name, e ## name; \
     uint32_t _e ## name; \
 }